local cache = reload("random.cache")
local newt = reload("newt")
local gather = newt()

---不重复随机-缓存版本-集合
---@param  list any[] 				    @随机数组
---@param  map  table<any,true>|nil	    @排除数据
---@return fun(index:integer|nil):integer   @随机闭包
return function (list, map)
    local tab = gather[list]
    if not tab then
        tab = newt()
        tab.func, tab.cache = cache(list, map)
    end
    gather[list] = tab
    return tab.func, tab.cache
end
